<template>
  <div class="da" v-cloak>
    <div class="title">文章排行榜top10</div>
    <ul v-cloak>
      <li v-for="(item, index) in list" :key="index" @click="tiao(item.id)"> top:{{index+1}}
      {{item.title}}&emsp; {{item.user}}&emsp; 阅读量:{{item.liulan}}
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  data(){
    return{
      list:[]
    }
  },
  methods:{
    tiao(val){
      this.axios.get('/kan/'+val).then((res)=>{
      console.log(res);
    })
      this.$router.push('/wenzhang/'+val)
    }
  },
  created(){
    this.axios.get('/rebang').then((res)=>{
      this.list=res.data
    })
  }
}
</script>
<style lang="less" scoped>
*{
  list-style: none;
  padding: 0;
  margin: 0;
}
  .da{
    padding: 20px;
    width: 100%;
    background-color: #73e18a69;
    border-radius: 10px;
    box-shadow: 2px 2px 15px #53a662;
  }
  .title{
    width: 100%;
    text-align: center;
    height: 30px;
    line-height: 30px;
    font-size: 22px;
  }
  ul{
    text-align: center;
  }
  li{
    height: 50px;
    font-size: 18px;
    line-height: 50px;
    border-bottom: 1px #939493 solid;
  }
  [v-cloak]{
    display: none;
  }
</style>